import type { RouteRecordRaw } from 'vue-router'

const loadComponent = (name: string) => {
  return () => import(/* webpackChunkName: "taa" */ `@/views/taa/${name}/index.vue`)
}

export const routes: Array<RouteRecordRaw> = [
  {
    path: 'carbon-target-management/factory-target',
    component: loadComponent('carbonTargetManagement/factoryTarget'),
    name: 'FactoryTarget',
    meta: {
      title: '工厂碳目标管理',
      keepAlive: true,
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-target-management/factory-target/target-detail/:targetNo',
    component: loadComponent('carbonTargetManagement/factoryTarget/targetDetail'),
    name: 'FactoryTargetDetail',
    meta: {
      title: '碳目标详情',
      bgColor: '#F3F7FB',
      selectKeysPath: '/carbon-target-management/factory-target',
      breadcrumb: [
        {
          name: '工厂碳目标管理',
          path: '/carbon-target-management/factory-target'
        },
        {
          name: '碳目标详情',
          path: false
        }
      ],
      keepAliveParentName: ['FactoryTarget'],
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-target-management/carbon-reduction-project',
    component: loadComponent('carbonTargetManagement/carbonReductionProject'),
    name: 'CarbonReductionProject',
    meta: {
      title: '碳减排项目',
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-target-management/factory-carbon-monitoring',
    component: loadComponent('carbonTargetManagement/factoryCarbonMonitoring'),
    name: 'FactoryCarbonMonitoring',
    meta: {
      title: '工厂能碳监控',
      keepAlive: true,
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-target-management/factory-carbon-monitoring/monitoring-detail',
    component: loadComponent('carbonTargetManagement/factoryCarbonMonitoring/monitoringDetail'),
    name: 'FactoryCarbonMonitoringDetail',
    meta: {
      title: '工厂能碳监控详情',
      bgColor: '#F3F7FB',
      selectKeysPath: '/carbon-target-management/factory-carbon-monitoring',
      breadcrumb: [
        {
          name: '工厂能碳监控',
          path: '/carbon-target-management/factory-carbon-monitoring'
        },
        {
          name: '工厂能碳监控详情',
          path: false
        }
      ],
      keepAliveParentName: ['FactoryCarbonMonitoring'],
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-asset-management/inspect-list',
    component: loadComponent('carbonAssetManagement/inspectList'),
    name: 'InspectList',
    meta: {
      title: '核查与履约',
      activeMenu: '/taa'
    }
  },
  {
    path: '/carbon-asset-management/inspect/detail',
    component: loadComponent('carbonAssetManagement/inspectList/inspectDetail'),
    name: 'InspectListDetail222',
    meta: {
      title: '核查与履约详情',
      bgColor: '#F3F7FB',
      selectKeysPath: '/carbon-asset-management/inspect-list',
      breadcrumb: [
        {
          name: '核查与履约',
          path: '/carbon-asset-management/inspect-list'
        },
        {
          name: '核查与履约详情',
          path: false
        }
      ],
      keepAliveParentName: ['InspectList'],
      activeMenu: '/taa'
    }
  },
  {
    path: 'carbon-asset-management/carbon-asset-account',
    component: loadComponent('carbonAssetManagement/carbonAssetAccount'),
    name: 'CarbonAssetAccount',
    meta: {
      title: '碳资产账户',
      activeMenu: '/taa'
    }
  }
]

export default routes
